package com.pi.framework.web.controller;

import com.pi.framework.core.controller.BaseController;
import com.pi.framework.core.util.SecurityUtils;
import com.pi.sys.entity.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/dashboard")
public class DashboardController extends BaseController {

	@SuppressWarnings("unused")
	private boolean isFront() {
		UserDetails user = SecurityUtils.getLoginUser();
		boolean front = false;
		if (user instanceof User) {
			front = ((User) user).isFront();
		}
		return front;
	}

	@GetMapping("")
	public String index(Model model) {
		return view("index");
	}
}
